import java.util.Arrays;

public class Solution832 {
    public int[][] flipAndInvertImage(int[][] image) {
        int[][] ans=new int[image.length][image.length];
        for (int i=0;i<image.length;i++){
            for (int j=0;j<image.length;j++){
                ans[i][j]=1-image[i][image.length-j-1];
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        int[][] ans=new Solution832().flipAndInvertImage(new int[][]{{1,1,0},{1,0,1},{0,0,0}});
        for (int[] an : ans) {
            System.out.println(Arrays.toString(an));
        }
    }
}
